#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n,k,ans;
LL cal(LL l,LL r)
{
	return (l+r)*(r-l+1)/2;
}
int main()
{
	scanf("%lld%lld",&n,&k);
	if(n>k)
	{
		ans=(n-k)*k;
		n=k;
	}
	LL r;
	for(LL i=1;i<=n;i=r+1)
	{
		LL t=k/i;
		r=k/t;
		r=min(r,n);
		ans+=(r-i+1)*k-t*cal(i,r);
	}
	printf("%lld\n",ans);
	return 0;
}
